#include <stdio.h>

int sqrt_bv(int n)
{
    int sqrt = 0;
    int shift = 15;
    int sqrt2;
    while (shift >= 0)
    {
        sqrt2 = ((sqrt << 1) + (1 << shift)) << shift;
        if (sqrt2 <= n)
        {
            sqrt += (1 << shift);
            n -= sqrt2;
        }
        shift--;
    }
    
    return sqrt;
}

int main(void)
{
    int a,b;
    
    while(1)
    {
        scanf("%d,%d",&a,&b);
        printf("result:%d\n",sqrt_bv(a*a+b*b));
    }
    return 0;
}